// components/w-tab-control/w-tab-control.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    titleContent: {
        type:Array,
        value:[],
        observer: function (newVal, oldVal) {
          console.log(newVal, oldVal);
        }
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    currentIndex: 0,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleItemClick:function(event) {
      var index = event.currentTarget.dataset.index;
      this.triggerEvent("itemclick",{index})
      this.setData({
        currentIndex: index
      })
    }
  }
})
